#!/bin/sh

# Many users are used to using vi instead of vim. To allow execution of vim when users habitually enter vi, create a symlink for both the binary and the man page in the provided languages:
ln -sv vim $FS_ROOT/usr/bin/vi
#for L in  $FS_ROOT/usr/share/man/{,*/}man1/vim.1; do
#	ln -sv vim.1 $(dirname $L)/vi.1
#done

# By default, Vim's documentation is installed in /usr/share/vim. The following symlink allows the documentation to be accessed via /usr/share/doc/vim-7.3, making it consistent with the location of documentation for other packages:
mv -fv $FS_ROOT/usr/share/vim/vim73/doc $FS_ROOT/usr/share/doc/vim-7.3

# By default, vim runs in vi-incompatible mode. This may be new to users who have used other editors in the past. The “nocompatible” setting is included below to highlight the fact that a new behavior is being used. It also reminds those who would change to “compatible” mode that it should be the first setting in the configuration file. This is necessary because it changes other settings, and overrides must come after this setting. Create a default vim configuration file by running the following:
cat > $FS_ROOT/etc/vimrc << "EOF"
" Begin /etc/vimrc

set nocompatible
set backspace=2
syntax on
if (&term == "iterm") || (&term == "putty")
	set background=dark
endif

" End /etc/vimrc
EOF
